﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ClasesBase
{
    public class Validacion
    {
        public bool val_codigo(string mitextbox)
        {
            Regex regex = new Regex(@"^[0-9]{1,6}$");
            return regex.IsMatch(mitextbox);

        }

        public bool val_cadena(string mitextbox)
        {

            Regex regex = new Regex(@"^[a-zA-Z ]+$");
            return regex.IsMatch(mitextbox);

        }
        public bool val_numero(string mitextbox)
        {

            Regex regex = new Regex(@"^([0-9])+$");
            return regex.IsMatch(mitextbox);

        }
        public bool val_telefono(string mitextbox)
        {

            Regex regex = new Regex(@"^([0-9]{7})$");
            return regex.IsMatch(mitextbox);

        }
        public bool val_dni(string mitextbox)
        {

            Regex regex = new Regex(@"^([0-9]{8})+$");
            return regex.IsMatch(mitextbox);

        }

    }
}
